package com.henry.newscafe;

public class Reader {
    private String name;

    Reader(String name) {
        this.name = name;
    }

    // get the read article name based on newspaper Issue number
    void readArticle(Newspaper newspaper) {
        System.out.println(this.name + " is reading: " +
                newspaper.getName() + ": " +
                newspaper.getNewestArticle());
    }

    // subscribe the newspaper
    void subscribe(Newspaper newspaper) {
        newspaper.addReader(this);
    }

    void unsubscribe(Newspaper newspaper) {
        newspaper.removeReader(this);
    }
}
